home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / T / Tools Plus 2.6 Evaluation.sit / Tools Plus 2.6 Evaluation Kit / Compiling the Demos next >
Encoding:
INI File  |  1995-04-14  |  13.1 KB  |  281 lines  |  [TEXT/ttxt]

  1. [Display using Geneva 12]
  2.  
  3.  
  4.  
  5. This document includes information about:
  6.   • compiling the demo application that is included with this
  7.      package
  8.   • resolving issues that may arise when compiling the demo
  9.  
  10.  
  11.  
  12.  
  13. Compiling The THINK C Demo Application
  14. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. The easiest way to compile the C demo application included with Tools Plus is to have the following files in the same folder:
  16.     Demo.π
  17.     Demo.π.rsrc
  18.     Demo.c
  19.     ToolsPlus.Lib1
  20.     ToolsPlus.Lib2
  21.     ToolsPlus.Lib3
  22.     ToolsPlus.h
  23.     ToolsPlus.c
  24.     PascalStrHandles.c
  25. Double-click the Demo.π project file to launch THINK C, then run your project.
  26.  
  27.   Your project file keeps track of each file’s location as you add it to your project, so you may want to create a new project file after you have put all the Tools Plus libraries and their related files in their permanent folders.  Create a new (empty) project named “Demo.π” in the same folder as “Demo.π.rsrc” and “PascalStrHandles.c”.  Add the following files to your new project:
  28.     Segment 1:   MacTraps
  29.                         MacTraps2
  30.     Segment 2:   ANSI
  31.     Segment 3:   ToolsPlus.Lib1
  32.     Segment 4:   ToolsPlus.Lib2
  33.     Segment 5:   ToolsPlus.Lib3
  34.                         ToolsPlus.c
  35.     Segment 6:   Demo.c
  36. You can now build your project and run your application.
  37.  
  38.  
  39. Note:
  40.   Make sure you allocate sufficient memory to the debugger if you are going to run the Tools Plus demo application with the debugger on.  The Tools Plus demo was written as one large source file, making it easier to compile and study, but making it hungry for debugger memory.  Allocate at least 500K to the debugger.  If you don’t have enough memory, turn the debugger off (Project menu, deselect “Use Debugger”) when running the demo.
  41.   Your applications will likely be written in a more intelligent fashion, abandoning one large source file in favor of several smaller ones.
  42.  
  43.  
  44.  
  45. IMPORTANT! Errors when compiling the THINK C Demo…
  46. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  47.   At the time of this writing, Water’s Edge Software has made every effort to ensure that our demo application will compile successfully the first time. Unfortunately, Symantec C/C++ compilers have undergone a series of revisions and some inconsistencies have arisen between compiler versions. Fortunately, these differences are simple to resolve.
  48.  
  49.   If your compiler gives you an error that states “argument to function ‘x’ does not match prototype,” it indicates that Symantec has made a minor revision to that function’s prototype (in the error message, ‘x’ will be replaced by the function’s name). To correct this error, inspect the offending line in the source file, which is likely a line like:
  50.  
  51.     PenPat(&gray);
  52.  
  53. and revise it to match the prototype in the related header file. In the example above, the correction is as simple as changing the line to:
  54.  
  55.     PenPat(gray);        /* Remove ampersand (&) from the variable */
  56.  
  57.  
  58.   To date, all inconsistencies have been of this nature. We are sorry for the inconvenience these issues may cause you, and would like to offer our assistance if you have problems getting the demo compiled. See the “Technical Support” chapter for information on how to contact Water’s Edge Software for assistance.
  59.  
  60. ------------------------------------------------------------
  61.  
  62.  
  63. Compiling The THINK Pascal Demo Application
  64. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  65. The easiest way to compile the Pascal demo application included with Tools Plus is to have the following files in the same folder:
  66.     Demo.π
  67.     Demo.π.rsrc
  68.     Demo.p
  69.     ToolsPlus.Lib1
  70.     ToolsPlus.Lib2
  71.     ToolsPlus.Lib3
  72.     ToolsPlus.p
  73. Double-click the Demo.π project file to launch THINK Pascal, then run your project.
  74.  
  75.   Your project file keeps track of each file’s location as you add it to your project, so you may want to create a new project file after you have put all the Tools Plus libraries and their related files in their permanent folders.  Create a new project named “Demo.π” in the same folder as “Demo.π.rsrc”.  Add the following files to your new project:
  76.     Segment 1:   Runtime.Lib
  77.                         Interface.Lib
  78.     Segment 2:   ToolsPlus.Lib1
  79.     Segment 3:   ToolsPlus.Lib2
  80.     Segment 4:   ToolsPlus.Lib3
  81.                         ToolsPlus.p
  82.     Segment 5:   Sound.p
  83.                         Demo.p
  84. You can now build your project.  After the initial compile, you will notice THINK Pascal created some additional entries in your project file:
  85.     «ToolsPlus.Lib1:1»
  86.     «ToolsPlus.Lib2:1»
  87.     «ToolsPlus.Lib3:1»
  88.     «%_MethTables»
  89.     «%_SelProcs»
  90.     «%_Profiler»
  91.  
  92.   The «ToolsPlus.Lib1:1», «ToolsPlus.Lib2:1» and «ToolsPlus.Lib3:1» items contain the object code from the Tools Plus libraries, while «%_MethTables», «%_SelProcs» and «%_Profiler» items are part of THINK Pascal’s overhead (consult your THINK Pascal User Manual for details).
  93.  
  94.   Drag «ToolsPlus.Lib1:1» into the same segment as ToolsPlus.Lib1, «ToolsPlus.Lib2:1» into the same segment as ToolsPlus.Lib2, and «ToolsPlus.Lib3:1» into the same segment as ToolsPlus.Lib3.
  95.  
  96.   Drag «%_MethTables», «%_SelProcs» and «%_Profiler» to any segment that won’t be unloaded while your application is running, such as the one containing the Runtime.lib library.
  97.  
  98.   Even though the project window indicates that Segment 1 exceeds the 32k limit imposed on segments, the project will compile and run.  When you build your application, the smart linker will strip away unneeded code and significantly reduce the size of this segment.
  99.  
  100.  
  101.  
  102.  
  103. ------------------------------------------------------------
  104.  
  105.  
  106. Compiling the CodeWarrior C (68K) Demo Application
  107. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  108. The easiest way to compile the CodeWarrior C demo application included with Tools Plus is to have the following files in the same folder:
  109.     Demo.µ
  110.     Demo.π.rsrc
  111.     Demo.c
  112.     ToolsPlus.Lib
  113.     ToolsPlus.h
  114.     ToolsPlus.c
  115.     PascalStrHandles.c
  116. Double-click the Demo.µ project file to launch CodeWarrior C/C++, then run your project.
  117.  
  118.   If you are creating a new project (instead of using the one included as part of Tools Plus), copy the files “Demo.µ”, “Demo.π.rsrc” and “PascalStrHandles.c” to the folder containing your project.  Add the following files to your new project:
  119.     Segment 1:   MacOS.Lib
  120.                         ANSI (2i) C.68K.Lib    (or equivalent)
  121.                         Pascal/RT.68K.Lib      (or equivalent)
  122.     Segment 2:   ToolsPlus.Lib
  123.                         ToolsPlus.c
  124.     Segment 3:   Demo.π.rsrc
  125.                         Demo.c
  126.  
  127. (Note that “Pascal/RT.68K.Lib” is part of your Pascal compiler.)
  128.  
  129.   You can now build your project and run your application.
  130.  
  131.  
  132.  
  133.  
  134. ------------------------------------------------------------
  135.  
  136.  
  137. Compiling the CodeWarrior Pascal (68K) Demo Application
  138. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  139. The easiest way to compile the CodeWarrior Pascal demo application included with Tools Plus is to have the following files in the same folder:
  140.     Demo.µ
  141.     Demo.π.rsrc
  142.     Demo.p
  143.     ToolsPlus.Lib
  144.     ToolsPlus.p
  145. Double-click the Demo.µ project file to launch CodeWarrior Pascal, then run your project.
  146.  
  147.   If you are creating a new project (instead of using the one included as part of Tools Plus), copy the files “Demo.µ” and “Demo.π.rsrc” to the folder containing your project.  Add the following files to your new project:
  148.     Segment 1:   Pascal/MacOS.Lib
  149.                         Pascal/RT.68K.Lib
  150.                         MacIntf(MPW).Lib    (or equivalent interface)
  151.                         P/ANSI.68K.Lib       (or equivalent)
  152.     Segment 2:   ToolsPlus.Lib
  153.                         ToolsPlus.p
  154.     Segment 3:   Demo.π.rsrc
  155.                         Demo.p
  156.  
  157. You can now build your project and run your application.
  158.  
  159.  
  160.  
  161.  
  162. ------------------------------------------------------------
  163.  
  164.  
  165. Compiling the CodeWarrior C (PPC) Demo Application
  166. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  167. The easiest way to compile the CodeWarrior C demo application included with Tools Plus is to have the following files in the same folder:
  168.     Demo.µ
  169.     Demo.π.rsrc
  170.     Demo.c
  171.     ToolsPlus.Lib
  172.     ToolsPlus.h
  173.     ToolsPlus.c
  174.     PascalStrHandles.c
  175. Double-click the Demo.µ project file to launch CodeWarrior C/C++, then run your project.
  176.  
  177.   If you are creating a new project (instead of using the one included as part of Tools Plus), copy the files “Demo.µ”, “Demo.π.rsrc” and “PascalStrHandles.c” to the folder containing your project.  Add the following files to your new project:
  178.       Group 1:   MWCRuntime.Lib
  179.                       InterfaceLib
  180.                       ANSI C.PPC.Lib           (or equivalent)
  181.                       Pascal/Rt.PPC.Lib      (or equivalent)
  182.       Group 2:   ToolsPlus.Lib
  183.                       ToolsPlus.c
  184.       Group 3:   Demo.π.rsrc
  185.                       Demo.c
  186. (Note that “Pascal/Rt.PPC.lib” is part of your Pascal compiler.)
  187.  
  188.   You can now build your project and run your application.
  189.  
  190.  
  191.  
  192.  
  193. ------------------------------------------------------------
  194.  
  195.  
  196. Compiling the CodeWarrior Pascal (PPC) Demo Application
  197. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  198. The easiest way to compile the CodeWarrior Pascal demo application included with Tools Plus is to have the following files in the same folder:
  199.     Demo.µ
  200.     Demo.π.rsrc
  201.     Demo.p
  202.     ToolsPlus.Lib
  203.     ToolsPlus.p
  204. Double-click the Demo.µ project file to launch CodeWarrior Pascal, then run your project.
  205.  
  206.   If you are creating a new project (instead of using the one included as part of Tools Plus), copy the files “Demo.µ” and “Demo.π.rsrc” to the folder containing your project.  Add the following files to your new project:
  207.       Group 1:   MWPRuntime.Lib
  208.                      InterfaceLib
  209.                      MacIntf(UPI).PPC.Lib      (or equivalent interface)
  210.                      Pascal/ANSI.PPC.Lib     (or equivalent)
  211.                      Pascal/Rt.PPC.Lib
  212.       Group 2:   ToolsPlus.Lib
  213.                      ToolsPlus.p
  214.       Group 3:   Demo.π.rsrc
  215.                      Demo.p
  216.  
  217. You can now build your project and run your application.
  218.  
  219.  
  220.  
  221.  
  222. ------------------------------------------------------------
  223.  
  224.  
  225. Errors when compiling the CodeWarrior demos (or applications):
  226. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  227.   At the time of this writing, Water’s Edge Software has made every effort to ensure that our demo application will compile successfully the first time. Unfortunately, Apple (who produces the C/C++ headers and Pascal interfaces into the Macintosh’s toolbox) and Metrowerks development environments are undergoing a series of revisions. As a result, some inconsistencies may arise between compiler versions. Fortunately, these differences are simple to resolve.
  228.  
  229. Access Paths
  230. ~~~~~~~~~~
  231.   When using Tools Plus for CodeWarrior C/C++ (680x0 or PowerMac), a Pascal runtime library is required. You may have to change the Access Path (in your project’s preferences) to locate the required file. This applies to the demo application as well as the project in the “starter files” folder.
  232.  
  233. File Names
  234. ~~~~~~~~~
  235.   Metrowerks occasionally changes the names of their libraries. If your demo project (or starter project) can’t locate a file, remove the problem file from your project then add the equivalent, correctly named file. An Access Path to the correctly named file will be created automatically if it is required.
  236.  
  237. Routine Names
  238. ~~~~~~~~~~~
  239.   At the time of this writing, Apple was still revising the routine and constants names in their universal interfaces. Your compiler or linker will find these inconsistencies and bring them to your attention. If the application you are compiling uses constants that have been renamed in the new universal interfaces, you can resolve this in one of two ways:
  240.  
  241. 1) Go through your source code and replace all occurrences of the old
  242.     constant with the new constant name
  243.  
  244. 2) Define the old constant in a C/C++ header or Pascal interface file
  245.  
  246.   If the application you are compiling uses routine names that have been renamed in the new universal interfaces, the linker will discover this and report it to you. You can resolve this in one of two ways:
  247.  
  248. 1) Go through your source code and replace all occurrences of the old
  249.     routine name with the new routine name
  250.  
  251. 2) “Map” the old routine name to the new routine name used in the
  252.     newest universal interfaces. If a Tools Plus library refers to a
  253.     routine that has been renamed in the new universal interfaces,
  254.     define the old routine (so that the Tools Plus library can find it),
  255.     and have the old routine call the new routine. The following
  256.     example shows you how to do this:
  257.  
  258.        function GetCtlValue (theControl: ControlRef): INTEGER;
  259.        begin
  260.          GetCtlValue := GetControlValue(theControl)
  261.        end;
  262.  
  263.     The above example illustrates how the old GetCtlValue routine is
  264.     mapped to the new GetControlValue routine found in the universal
  265.     interfaces. Make sure that you defile the old routine with
  266.     identical parameter names and types as the new routine.
  267.  
  268. ------------------------------------------------------------
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276. Having Problems?
  277. ~~~~~~~~~~~~~
  278. If you are having problems compiling the demo or getting Tools Plus to work flawlessly, please contact Water’s Edge Software Technical Support (see the “Technical Support” chapter for details).
  279.  
  280. We pride ourselves on our product excellence and customer service, and we’d like to help you start using Tools Plus as quickly as possible!
  281.